package com.compass.doctor.ui.mine.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.doctor.R
import com.compass.doctor.databinding.LayoutEvaluateItemBinding
import com.compass.doctor.databinding.LayoutEvaluateTagItemBinding
import com.compass.doctor.databinding.LayoutPatientMenuTagItemBinding
import com.compass.framework.adapter.BaseBindViewHolder
import com.compass.framework.adapter.BaseRecyclerViewAdapter
import com.compass.framework.model.PrescriptionStatus
import com.compass.framework.model.ScreenTag
import com.compass.framework.utils.getColorFromResource
import com.compass.framework.utils.getDrawableResource

/**
 * Description： 评价筛选Tag adapter
 * Date:2023/12/30 20:55
 */
class EvaluateTagAdapter : BaseRecyclerViewAdapter<PrescriptionStatus, LayoutEvaluateTagItemBinding>() {
    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutEvaluateTagItemBinding>,
        item: PrescriptionStatus?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            actionText.text = item.label
            if (item.isSelect) {
                actionText.background= getDrawableResource(R.drawable.btn_shape_blue_50)
                actionText.setTextColor(getColorFromResource(R.color.white))
            } else {
                actionText.background= getDrawableResource(R.drawable.btn_shape_patient_tag_50)
                actionText.setTextColor(getColorFromResource(R.color.color_2e344a))
            }
        }
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutEvaluateTagItemBinding {
        return LayoutEvaluateTagItemBinding.inflate(layoutInflater, parent, false)
    }
}